/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ro.pub.cs.dfsa.client.connection;

import java.io.IOException;

/**
 *
 * @author Narcis
 */
public abstract class AbstractClientConnection {
    protected String serverAddress;
    protected int serverPort;
    protected int clientPort;
    
    public AbstractClientConnection() {
        
    }
    
    public abstract void createConnection() throws IOException;
    public abstract <T> T readObject(Class<T> clazz) throws IOException, ClassNotFoundException;
    public abstract void writeObject(Object o) throws IOException;
    public abstract boolean isClosed();
    public abstract void close() throws IOException;
    
    public String getServerAddress() {
        return serverAddress;
    }

    public void setServerAddress(String serverAddress) {
        this.serverAddress = serverAddress;
    }

    public int getServerPort() {
        return serverPort;
    }

    public void setServerPort(int serverPort) {
        this.serverPort = serverPort;
    }

    public int getClientPort(){
        return clientPort;
    }

    public void setClientPort(int clientPort){
        this.clientPort = clientPort;
    }
}
